﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using verk2013_project_group12.Models;

namespace verk2013_project_group12.Models
{
    public class NewsRepository
    {
        AppDataContext db = new AppDataContext();

        public IEnumerable<NewsItem> GetAllNews()
        {
            return db.NewsItems;
        }

        public void Save()
        {

            db.SaveChanges();
        }

        public void Add(NewsItem item)
        {
            db.NewsItems.Add(item);

        }
       
    }
}